package com.campus.entity.vo;

import com.campus.entity.Schedule;
import lombok.Data;

@Data
public class ScheduleVO {
    private String id;
    private String account;
    private String title;
    private String duration;
    private String beginTime;
    private String tips;
    private Integer isOver;
    private Integer delFlag;


    public ScheduleVO(Schedule schedule) {
        this.id = String.valueOf(schedule.getId());
        this.account = schedule.getAccount();
        this.title = schedule.getTitle();
        long diff = schedule.getEndTime().getTime() - schedule.getBeginTime().getTime();
        this.duration = String.valueOf(diff / 1000 / 60);
        //        this.beginTime=String.valueOf(schedule.getBeginTime());
        this.beginTime = String.valueOf(schedule.getBeginTime()).substring(11, 16);
        this.tips = schedule.getTips();
        this.isOver = schedule.getIsOver();
        this.delFlag = schedule.getDelFlag();
    }

    public ScheduleVO() {
    }
}
